////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//	MathQuaternion.h
//  MathLib
//
//  Created by Gregory Maks on 8/14/09.
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef MATH_QUATERNION_H
#define MATH_QUATERNION_H

#include "MathDefines.h"



// predefinitions to avoid collisions
struct Vector4;
// ----------------------------------


struct Quaternion
{
public:
	// vars
	floatType x, y, z, w;
	

public:
	void ctor ();
	
	// constructors
	Quaternion ();
	Quaternion (Vector4 &axis, floatType angle);
	Quaternion (floatType axisX, floatType axisY, floatType axisZ, floatType angle);
		
	// creation methods
	void InitWithIdentity ();
	void InitWithRotationAroundAxis (Vector4 &axis, floatType angle);
	void InitWithRotationAroundAxis (floatType axisX, floatType axisY, floatType axisZ, floatType angle);
	
	// methods
	void Multiply (Quaternion &quat);
	void Normalize ();
	floatType Magnitude ();
	
	// debug methods
	void Printf ();
	
	// operators
	Quaternion operator* (Quaternion &quat);
	Quaternion& operator*= (Quaternion &quat);
	
	bool operator== (Quaternion &quat);
	bool operator!= (Quaternion &quat);
};


#endif //MATH_QUATERNION_H